<template>
  <div id="adminIndex">
    <bars></bars>
    <main class="col-md-9 ms-sm-auto col-lg-10 px-md-4">
      <h1>hhh</h1>
    </main>
  </div>
</template>

<script>
import bars from "@/components/util/bars";
export default {
  data() {
      return{

      }
  },
  mounted(){
      if(this.getCookie('user_id')==''||this.getCookie('jwt_token')==null){
          this.$router.push({ path: "/login"});
      }else{

      }
  },
  methods:{
      getCookie(name) {
      var arr = document.cookie.match(
        new RegExp("(^| )" + name + "=([^;]*)(;|$)")
      );
      if (arr != null) return unescape(arr[2]);
      return null;
    },
    logOut() {
      this.$cookies.set("user_id", "");
      this.$cookies.set("jwt_token", null);
      this.$router.push({ path: "/login"});
    },
  },
  components: {
    bars: bars
  },
};
</script>
